{% extends 'layouts/base.html' %}
{% block content %}
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <form action="{{ url('backend/service/edit', {ser_id:service.ser_id}) }}" class="form-horizontal" role="form" method="post" enctype="multipart/form-data">

            <div class="form-group{% if errors['ser_name'] is not empty %} has-error{%endif%}">
                <label for="ser_name" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">业务分类名称<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="ser_name" placeholder="业务分类名称" name="ser_name" class="col-xs-12" value="{{service.ser_name}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['ser_name'] is not empty %}{{errors['ser_name']}}{% else %} {%endif%} </div>
            </div>
            
            <div class="form-group{% if errors['ser_code'] is not empty %} has-error{%endif%}">
                <label for="ser_code" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">业务分类代码<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="ser_code" placeholder="业务分类代码" name="ser_code" class="col-xs-12" value="{{service.ser_code}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['ser_code'] is not empty %}{{errors['ser_code']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['special_bill'] is not empty %} has-error{%endif%}">
                <label for="ser_code" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">增值税专用发票</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="special_bill" placeholder="增值税专用发票比率，用0～100表示，默认为0个点" name="special_bill" class="col-xs-12" value="{{service.special_bill}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['special_bill'] is not empty %}{{errors['special_bill']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['normal_bill'] is not empty %} has-error{%endif%}">
                <label for="ser_code" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">增值税普通发票</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="text" id="normal_bill" placeholder="增值税普通发票比率，用0～100表示，默认为0个点" name="normal_bill" class="col-xs-12" value="{{service.normal_bill}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['normal_bill'] is not empty %}{{errors['normal_bill']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['content'] is not empty %} has-error{%endif%}">
                <label for="ser_code" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">描述</label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <textarea type="text" id="content" placeholder="描述" name="content" class="col-xs-12" value="{{service.content}}" ></textarea>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['content'] is not empty %}{{errors['content']}}{% else %} {%endif%} </div>
            </div>

            <div class="form-group{% if errors['sort'] is not empty %} has-error{%endif%}">
                <label for="ser_code" class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right">排序<span class="red">*</span></label>
                <div class="col-xs-12 col-sm-4">
                    <span class="block input-icon input-icon-right">
                        <input type="tel" class="smort-input"  id="sort" placeholder="1" name="sort" class="col-xs-12" value="{{service.sort}}" />
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline"> {% if errors['sort'] is not empty %}{{errors['sort']}}{% else %} {%endif%} </div>
            </div>


            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        提交
                    </button>

                    &nbsp; &nbsp; &nbsp;
                    <a class="btn" href="javascript:;" onclick="history.back(); ">
                        <i class="ace-icon fa fa-undo bigger-110"></i>
                        后退
                    </a>
                </div>
            </div>

        </form>
    </div><!-- /.col -->
</div><!-- /.row -->
{% endblock %}
{% block script %}

<script type="text/javascript">
    $(document).ready(function(){

        $(".ace-switch").each(function () {
            var aceswitch = this;

            aceswitch.addEventListener("click", function(){
                id = this.id.replace("_radio", "");
                if(this.checked){
                    $("#"+id).val('1');
                } else {
                    $("#"+id).val('0');
                }
                });
        });
    });
    $('#addtime').datetimepicker({format: 'YYYY-MM-DD hh:mm:ss'}).next().on(ace.click_event, function(){
        $(this).prev().focus();
    });
</script>

{% endblock %}
